using Microsoft.Phone.Data.Linq.Mapping;
using System;
using System.Data.Linq;
using System.Data.Linq.Mapping;
namespace MicroMsg.Storage
{
	[Index(Columns = "strUsrName", IsUnique = false, Name = "strUsrName"), Table]
	public class MobileContact : StorageItem
	{
		private const int Field_strMD5 = 1;
		private const int Field_strUsrName = 2;
		private const int Field_strNickName = 4;
		private const int Field_strNickNamePYInitial = 8;
		private const int Field_strNickNameQuanPin = 16;
		private const int Field_strRealName = 32;
		private const int Field_strRealNamePYInitial = 64;
		private const int Field_strRealNameQuanPin = 128;
		private const int Field_strMobile = 256;
		private const int Field_strEmail = 512;
		private const int Field_nType = 1024;
		private const int Field_nStatus = 2048;
		private const int Field_nUploadTime = 4096;
		private const int Field_nFlag = 8192;
		private const int Field_strSignature = 16384;
		private const int Field_nSex = 32768;
		private const int Field_strProvince = 65536;
		private const int Field_strCity = 131072;
		private const int Field_hasHeadImg = 262144;
		private const int Field_nPersonalCard = 524288;
		private const int Field_lastUpdateTime = 1048576;
		private const int Field_strAlias = 2097152;
		private string _strMD5;
		private string _strUsrName;
		private string _strNickName;
		private string _strNickNamePYInitial;
		private string _strNickNameQuanPin;
		private string _strRealName;
		private string _strRealNamePYInitial;
		private string _strRealNameQuanPin;
		private string _strMobile;
		private string _strEmail;
		private int _nType;
		private int _nStatus;
		private long _nUploadTime;
		private uint _nFlag;
		private string _strSignature;
		private int _nSex;
		private string _strProvince;
		private string _strCity;
		private int _hasHeadImg;
		private uint _nPersonalCard;
		private long _lastUpdateTime;
		private string _strAlias;
		[Column(IsVersion = true)]
		private Binary _version;
		[Column(DbType = "Image")]
		public byte[] bytesXmlBuf;
		private MobileContactXmlData _xmlData;
		[Column(IsPrimaryKey = true)]
		public string strMD5
		{
			get
			{
				return this._strMD5;
			}
			set
			{
				this._strMD5 = value;
				this.modify |= 1L;
			}
		}
		[Column]
		public string strUsrName
		{
			get
			{
				return this._strUsrName;
			}
			set
			{
				this._strUsrName = value;
				this.modify |= 2L;
			}
		}
		[Column]
		public string strNickName
		{
			get
			{
				return this._strNickName;
			}
			set
			{
				this._strNickName = value;
				this.modify |= 4L;
			}
		}
		[Column]
		public string strNickNamePYInitial
		{
			get
			{
				return this._strNickNamePYInitial;
			}
			set
			{
				this._strNickNamePYInitial = value;
				this.modify |= 8L;
			}
		}
		[Column]
		public string strNickNameQuanPin
		{
			get
			{
				return this._strNickNameQuanPin;
			}
			set
			{
				this._strNickNameQuanPin = value;
				this.modify |= 16L;
			}
		}
		[Column]
		public string strRealName
		{
			get
			{
				return this._strRealName;
			}
			set
			{
				this._strRealName = value;
				this.modify |= 32L;
			}
		}
		[Column]
		public string strRealNamePYInitial
		{
			get
			{
				return this._strRealNamePYInitial;
			}
			set
			{
				this._strRealNamePYInitial = value;
				this.modify |= 64L;
			}
		}
		[Column]
		public string strRealNameQuanPin
		{
			get
			{
				return this._strRealNameQuanPin;
			}
			set
			{
				this._strRealNameQuanPin = value;
				this.modify |= 128L;
			}
		}
		[Column]
		public string strMobile
		{
			get
			{
				return this._strMobile;
			}
			set
			{
				this._strMobile = value;
				this.modify |= 256L;
			}
		}
		[Column]
		public string strEmail
		{
			get
			{
				return this._strEmail;
			}
			set
			{
				this._strEmail = value;
				this.modify |= 512L;
			}
		}
		[Column]
		public int nType
		{
			get
			{
				return this._nType;
			}
			set
			{
				this._nType = value;
				this.modify |= 1024L;
			}
		}
		[Column]
		public int nStatus
		{
			get
			{
				return this._nStatus;
			}
			set
			{
				this._nStatus = value;
				this.modify |= 2048L;
			}
		}
		[Column]
		public long nUploadTime
		{
			get
			{
				return this._nUploadTime;
			}
			set
			{
				this._nUploadTime = value;
				this.modify |= 4096L;
			}
		}
		[Column]
		public uint nFlag
		{
			get
			{
				return this._nFlag;
			}
			set
			{
				this._nFlag = value;
				this.modify |= 8192L;
			}
		}
		[Column]
		public string strSignature
		{
			get
			{
				return this._strSignature;
			}
			set
			{
				this._strSignature = value;
				this.modify |= 16384L;
			}
		}
		[Column]
		public int nSex
		{
			get
			{
				return this._nSex;
			}
			set
			{
				this._nSex = value;
				this.modify |= 32768L;
			}
		}
		[Column]
		public string strProvince
		{
			get
			{
				return this._strProvince;
			}
			set
			{
				this._strProvince = value;
				this.modify |= 65536L;
			}
		}
		[Column]
		public string strCity
		{
			get
			{
				return this._strCity;
			}
			set
			{
				this._strCity = value;
				this.modify |= 131072L;
			}
		}
		[Column]
		public int hasHeadImg
		{
			get
			{
				return this._hasHeadImg;
			}
			set
			{
				this._hasHeadImg = value;
				this.modify |= 262144L;
			}
		}
		[Column]
		public uint nPersonalCard
		{
			get
			{
				return this._nPersonalCard;
			}
			set
			{
				this._nPersonalCard = value;
				this.modify |= 524288L;
			}
		}
		[Column]
		public long lastUpdateTime
		{
			get
			{
				return this._lastUpdateTime;
			}
			set
			{
				this._lastUpdateTime = value;
				this.modify |= 1048576L;
			}
		}
		[Column]
		public string strAlias
		{
			get
			{
				return this._strAlias;
			}
			set
			{
				this._strAlias = value;
				this.modify |= 2097152L;
			}
		}
		public uint nSnsFlag
		{
			get
			{
				this.load();
				return this._xmlData.nSnsFlag;
			}
			set
			{
				this.load();
				this._xmlData.nSnsFlag = value;
				this.unload();
			}
		}
		public string strSnsBGImgID
		{
			get
			{
				this.load();
				return this._xmlData.strSnsBGImgID;
			}
			set
			{
				this.load();
				this._xmlData.strSnsBGImgID = value;
				this.unload();
			}
		}
		public ulong nSnsBGObjectID
		{
			get
			{
				this.load();
				return this._xmlData.nSnsBGObjectID;
			}
			set
			{
				this.load();
				this._xmlData.nSnsBGObjectID = value;
				this.unload();
			}
		}
		public override void merge(object object_0)
		{
			MobileContact mobileContact = object_0 as MobileContact;
			if (0L != (mobileContact.modify & 2L))
			{
				this._strUsrName = mobileContact._strUsrName;
			}
			if (0L != (mobileContact.modify & 4L))
			{
				this._strNickName = mobileContact._strNickName;
			}
			if (0L != (mobileContact.modify & 8L))
			{
				this._strNickNamePYInitial = mobileContact._strNickNamePYInitial;
			}
			if (0L != (mobileContact.modify & 16L))
			{
				this._strNickNameQuanPin = mobileContact._strNickNameQuanPin;
			}
			if (0L != (mobileContact.modify & 32L))
			{
				this._strRealName = mobileContact._strRealName;
			}
			if (0L != (mobileContact.modify & 64L))
			{
				this._strRealNamePYInitial = mobileContact._strRealNamePYInitial;
			}
			if (0L != (mobileContact.modify & 128L))
			{
				this._strRealNameQuanPin = mobileContact._strRealNameQuanPin;
			}
			if (0L != (mobileContact.modify & 256L))
			{
				this._strMobile = mobileContact._strMobile;
			}
			if (0L != (mobileContact.modify & 512L))
			{
				this._strEmail = mobileContact._strEmail;
			}
			if (0L != (mobileContact.modify & 1024L))
			{
				this._nType = mobileContact._nType;
			}
			if (0L != (mobileContact.modify & 2048L))
			{
				this._nStatus = mobileContact._nStatus;
			}
			if (0L != (mobileContact.modify & 4096L))
			{
				this._nUploadTime = mobileContact._nUploadTime;
			}
			if (0L != (mobileContact.modify & 8192L))
			{
				this._nFlag = mobileContact._nFlag;
			}
			if (0L != (mobileContact.modify & 16384L))
			{
				this._strSignature = mobileContact._strSignature;
			}
			if (0L != (mobileContact.modify & 32768L))
			{
				this._nSex = mobileContact._nSex;
			}
			if (0L != (mobileContact.modify & 65536L))
			{
				this._strProvince = mobileContact._strProvince;
			}
			if (0L != (mobileContact.modify & 131072L))
			{
				this._strCity = mobileContact._strCity;
			}
			if (0L != (mobileContact.modify & 262144L))
			{
				this._hasHeadImg = mobileContact._hasHeadImg;
			}
			if (0L != (mobileContact.modify & 524288L))
			{
				this._nPersonalCard = mobileContact._nPersonalCard;
			}
			if (0L != (mobileContact.modify & 1048576L))
			{
				this._lastUpdateTime = mobileContact._lastUpdateTime;
			}
			if (0L != (mobileContact.modify & 2097152L))
			{
				this._strAlias = mobileContact._strAlias;
			}
		}
		private void load()
		{
			if (this._xmlData != null)
			{
				return;
			}
			this._xmlData = StorageXml.loadFromBuffer<MobileContactXmlData>(this.bytesXmlBuf);
			if (this._xmlData == null)
			{
				this._xmlData = new MobileContactXmlData();
			}
		}
		private void unload()
		{
			this.bytesXmlBuf = StorageXml.saveToBuffer<MobileContactXmlData>(this._xmlData);
		}
	}
}
